﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using DevExpress.XtraScheduler.Native;
using DevExpress.XtraScheduler;

namespace Lamex.mNC.UI
{
    public partial class frmNC_Convert_Non_Working_Day : frmBaseChild
    {
        public frmNC_Convert_Non_Working_Day()
        {
            InitializeComponent();
        }

        private void frmNC_Convert_Non_Working_Day_Load(object sender, EventArgs e)
        {
            //gridView1参考Lamex.mSchedule.UI.frmSCH_Internal_Order_Confirm

            //Devexpress datenavigator 得到所选择的日期
            IDateNavigatorControllerOwner owner = this.dateNavigator1 as IDateNavigatorControllerOwner;
            DayIntervalCollection selection = owner.GetSelection();

            var dateArray = selection.ToArray();
            var selectedDates = string.Empty;

            for (int i = 0; i < dateArray.Length; i++)
            {
                if (i == 0)
                {
                    selectedDates = dateArray[i].Start.ToString("yyyy-MM-dd");
                }
                else
                {
                    selectedDates = selectedDates + "," + dateArray[i].Start.ToString("yyyy-MM-dd");
                }
            }

        }
    }
}